1. Field of the Invention
The present invention relates to a method of terminating asynchronous CPU processes at the time of occurrence of an interruption and to a method of reporting CPU-resource-using process-dependent factors generated in the asynchronous CPU processes for use in a CPU which executes some CPU resource using processes with long processing times, asynchronously with instructions while guaranteeing data-dependent relationships of the processes. (Although a process is initiated by an instruction, the process is terminated after the instruction is terminated. After executing the instruction that initiated the process, the CPU initiates execution of a next instruction before termination of the initiated process.) The present invention is especially effective in executing basic processes used in an OS interruption handler asynchronously with instruction execution.
2. Description of the Related Art
In a CPU which executes a CPU-resource-using processes with a long processing time asynchronously with execution of an initiating instruction, partial prior execution of an instruction succeeding a preceding instruction which is long in processing time can be performed by partial prior execution of the succeeding instruction and canceling the effect of the preceding instruction when a program interruption is generated in the initiated by the preceding instruction process. In this case, however, the instruction pipeline of the CPU becomes complicated and the extent of prior execution of the succeeding instruction is limited.
An effective method of improving the CPU's performance without stopping the execution of a simultaneously executable succeeding CPU instruction (bearing no data-dependent relationship with the previous process) when the previous process requires a long processing time time in a CPU-resource, is to execute the CPU-resource-using process with a long processing time asynchronously with the execution of the succeeding instruction. Using this method, a plurality of, CPU-resource-using processes containing more than one asynchronous CPU-resource-using process will be executed at the same time.
In conventional computers, the following methods are used to terminate a CPU-resource-using process when an interruption occurs. There are two types of interruptions: CPU-resource-using process-dependent interruptions; and CPU-resource-using process-independent interruptions.
(1) All CPU-resource-using processes are executed synchronously with instructions. When a CPU-resource-using process-dependent interruption factor is detected as a result of an execution of an instruction, a corresponding CPU-resource-using process-dependent interruption is generated prior to the execution of the next instruction after the termination of the execution of the instruction. Only when no CPU-resource-using process-dependent interruption is detected at the execution of the last instruction and a CPU-resource-using process-independent factor is present, a corresponding CPU-resource using-process-independent interruption is generated.
In the situation where all the CPU-resource-using processes initiated prior to an interruption have been terminated at the time of the occurrence of the interruption, an interruption handler is easy to construct. In the case of an interruption for a necessary CPU-resource-using process-dependent factor, an original program can be resumed after proper processing by the interruption handler.
In the case of the previously described situation in a process (instruction) executing system, however, the execution of a succeeding CPU-resource-using process cannot be terminated during the execution of a CPU-resource using process with a long execution time, thus degrading the performance of the CPU.
(2) A unit (for example, a floating-point arithmetic unit) performs input/output operations on some of the CPU resources and asynchronously executes processes (asynchronous CPU-resource-using processes) which are initiated by instructions and executed asynchronously with the execution of the instructions. Where a CPU-resource-using-process-dependent factor is detected in these asynchronous CPU-resource using processes, when a process using a CPU resource accessed by the unit or an instruction initiating a process that the unit executes is executed, a CPU resource-using process-dependent interruption held by the asynchronous operation unit is generated synchronously with the instruction without executing a process specified by the instruction.
When an interruption corresponding to an interruption factor other than a CPU-resource-using-process-dependent interruption factor is detected by the asynchronous operation unit, termination of the operation of the asynchronous operation unit does not wait. The CPU-resource-using-process-dependent interruption factor held by the asynchronous operation unit at this point is not reported simultaneously.
When the asynchronous operation unit holds a CPU-resource-using-process-independent interruption factor and a CPU-resource-using-process-dependent interruption factor at the same time, the latter takes no precedence over the former and the CPU-resource-using-process-dependent interruption factor remains held, so that a CPU-resource-using-process-independent interruption is generated.
Where an asynchronous CPU-resource using process and its output resource are not used in an environment save area of the interruption handler, the method constitutes an effective interruption system. However, the interruption system will have the following problems in the case of non-synchronization of basic CPU-resource-using-processes used in the interruption handler.
After the occurrence of an interruption (first interruption), an interruption (second interruption) for a CPU-resource-using-process-dependent interruption factor is generated which is detected in a process initiated by a program executed prior to the occurrence of the first interruption during the operation of the interruption handler which processes the first interruption. In the process for the second interruption, it becomes difficult or impossible to determine which of programs initiated the process that generated the interruption factor. In this case, therefore, the processing of the CPU-resource-using-process-dependent interruption detected by a CPU-resource using process used by the interruption handler becomes impossible or the interruption processing by the interruption handler becomes very complicated.
(3) An asynchronously operating unit executes an asynchronous CPU-resource-using process initiated by an instruction and executed asynchronously with the instruction. To use the output of the asynchronous unit in a succeeding process, there are two cases: the case in which a specified procedure is required; and the case in which the initiation of execution of an instruction for initiating the succeeding process is delayed.
When some interruption factor is detected, the CPU performs the following interruption operations.
1 It does not initiate the execution of a new instruction.
2 It waits until all processes (asynchronous CPU-resource using processes) being executed by the asynchronously operating unit are terminated. The asynchronously operating unit executes all of the processes whose execution have been initiated regardless of whether or not a CPU-resource-using-process-dependent interruption factor has been detected in a preceding process. A CPU-resource-using-process-dependent interruption factor is detected and an output whose value differs from an expected value is also used as it is in a succeeding process. In this case, the result of execution of the succeeding process will become different from an expected one and a CPU-resource-using-process-dependent interruption factor may be detected even in the succeeding process because an input does not have an expected value.
When detecting more than one CPU-resource-using-process-dependent interruption factor as a result of operation 2, the asynchronous operation unit holds the interruption factor detected first or all the interruption factors detected.
In the case where all the detected interruption factors are held, when a certain CPU-resource-using-process-dependent interruption factor triggers off the generation of a CPU-resource-using-process-dependent interruption factor in a succeeding process, it becomes difficult to specify the triggering interruption factor.
3 When, in operation 2, none of the CPU-resource-using-process-dependent interruption factors are detected, the CPU-resource-using-process-dependent interruption that initiates the interruption operation is generated.
When a CPU-resource-using-process-dependent interruption factor is detected, a CPU-resource-using-process-dependent interruption is generated without depending on the type of the interruption factor that initiated the interruption operation.
With this interruption handling system, since a CPU-resource-using-process-dependent interruption factor is detected and the execution of a process using its output which has become an expected value as an input is not stopped, non-synchronization of a process results (such as for storage into main memory, an unpredictable area is destroyed when, an address used as an input is abnormal) that cannot specify a resource which is destroyed when an input is abnormal and makes debugging the program very difficult.
In addition, with this interruption system, when a CPU-resource-using-process-dependent interruption factor is detected in the non-synchronized process, the original program cannot be resumed.